﻿#ifndef __MAP_APP_H__
#define __MAP_APP_H__

#include<memory>
#include<string>
#include<stdint.h>
#include"MapService.hpp"
#include"MapHandler.hpp"
#include"CommandHandler.hpp"
#include"Service.hpp"
#include"SessionMgr.hpp"
#include"../DataBase/EvSceneData.hpp"
#include"../Protocol/MapProtocol.hpp"



namespace SC_SUN
{

class SatelliteMGR;
class SecIslSNManGR;
class GnssManGR;
class KeTi2Mgr;


class MapApp
{

protected:

    std::string mRouter;
    uint16_t mPort;                                                                         ///< 端口号
    uint16_t mSockPort;
    std::shared_ptr<MapService> mService;                                                   ///< 服务
    std::shared_ptr<MapHandler> mHandler;                                                   ///< 回调函数
    std::shared_ptr<Service> mSockService;
    std::shared_ptr<CommandHandler> mSockHandler;
    std::shared_ptr<SessionMgr> mSockSessionMgr;
    std::string mCurScene = "F:/Projects/SC_Scene/All_Data_20251106";//"F:/Projects/All_Data/All_Data";                                ///< 当前场景(这里得改)
    std::vector<std::string> mSceneList;                                                    ///< 场景列表
    EvSceneData mSceneData;                                                                 ///< 场景信息数据
    std::shared_ptr<SatelliteMGR> mSatelliteMGR;                                            ///< 卫星管理器
    std::shared_ptr<SecIslSNManGR> mSecIslSNMGR;                                            ///< 星间信息管理器
    std::shared_ptr<GnssManGR> mGnssMGR;                                                    ///< GNSS管理器
    std::shared_ptr<KeTi2Mgr> mKeti2Mgr;                                                    ///< 课题二数据管理器
    uint64_t mSliceIdx = 0;                                                                 ///< 切片索引
    std::string mKeti2Path = "F:/Projects/SC_Scene/keti2";                                  ///< 课题二数据目录

public:

MapApp(const std::string& router, uint16_t port, uint16_t sockPort);
~MapApp();

std::vector<std::string> LoadSceneList();
std::string GetKeTi2Path() {return mKeti2Path;}

bool LoadScene();
bool Start();
void Stop();

void setSliceIdx(uint64_t slice);
uint64_t GetSliceIdx();

const std::string& CurScene();
const std::vector<std::string> GetSceneList();
void setCurScene(const std::string& curScene);
EvSceneData GetScene();
SceneTimeInfoMsg GetSceneTimeInfo();

SatelliteMGR& GetSatelliteMGR() {return *mSatelliteMGR;}
SecIslSNManGR& SecIslSNMGR() {return *mSecIslSNMGR;}
GnssManGR& GnssMGR() {return *mGnssMGR;}
KeTi2Mgr& Keti2Mgr() {return *mKeti2Mgr;}

std::shared_ptr<Service> GetSockService() {return mSockService;}
std::shared_ptr<CommandHandler> GetSockHandler() {return mSockHandler;}
std::shared_ptr<SessionMgr> GetSockSessionMgr() {return mSockSessionMgr;}

};

}


#endif
